GreenRelabellingMain_v3
Ndays=DaysBefore+DaysAfter+1;
qq=norminv([0.95 0.975 0.995]);
prec0='%11.0f'; prec1='%11.1f'; prec2='%11.2f';

er=100*mean(exret);
ster=std(100*exret)./sqrt(5);
erbond=100*mean(exretbond);
sterbond=std(100*exretbond)./sqrt(5);

% er=100*mean(exret([1:2 4:5],:));
% ster=std(100*exret([1:2 4:5],:))./sqrt(3);
% erbond=100*mean(exretbond([1:2 4:5],:));
% sterbond=std(100*exretbond([1:2 4:5],:))./sqrt(3);

str='\begin{table}[h]\begin{center}\begin{tabular}{l';
for t=1:Ndays, str=[str 'c']; end
str=[str '}\hline '];
str=[str 'Event day'];
for t=-DaysBefore:1:DaysAfter
    str=[str '&' num2str(t)];
end
str=[str '\\\hline '];
str=[str 'Equity'];
for t=1:Ndays
    str=[str '&$' num2str(er(t),prec2) '^{'];
    for u=1:length(qq), if abs(er(t)/ster(t))>qq(u), str=[str '*']; else end; end  
    str=[str '}$'];
end
    str=[str '\\'];
    for t=1:Ndays
        str=[str '&\begin{scriptsize}(' num2str(ster(t),prec2) ')\end{scriptsize} '];
    end 
str=[str '\\'];
str=[str 'Bonds'];
for t=1:Ndays
    str=[str '&$' num2str(erbond(t),prec2) '^{'];
    for u=1:length(qq), if abs(erbond(t)/sterbond(t))>qq(u), str=[str '*']; else end; end  
    str=[str '}$'];
end
    str=[str '\\'];
    for t=1:Ndays
        str=[str '&\begin{scriptsize}(' num2str(sterbond(t),prec2) ')\end{scriptsize} '];
    end
str=[str '\\\hline \end{tabular}\end{center}'];
str
